﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;

namespace ConcertSpace
{
    public partial class frmOptions : Form
    {
        GestionConcertsMyspace gl;

        public frmOptions(ref GestionConcertsMyspace gl)
        {
            InitializeComponent();

            this.gl = gl;

            textBox1.Text = gl.adresse;
        }

        private void frmOptions_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                gl.adresse = textBox1.Text;
                this.Close();
            }
            else
            {
                if (Application.CurrentCulture.TwoLetterISOLanguageName == "fr")
                {
                    MessageBox.Show("Veuillez entrer votre adresse !\nL'adresse sert uniquement pour les fonctionnalités d'itinéraire (RATP, Google Maps...), vous pouvez mettre uniquement votre ville...", "ConcertSpace", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Please enter your address !\nIt's only being used for the location based fonctionnalities (Google Maps, RATP...), you can type in only your city if you wish...", "ConcertSpace", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
